<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改联系人')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-contact-edit" th:object="${contact}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">姓名：</label>
				<div class="col-sm-8">
					<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属客户：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
						<select name="customerId" class="form-control m-b" th:with="type=${@customer.list()}">
		                    <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}" th:field="*{customerId}"></option>
		                </select>
		            </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系人类型：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('crm_contact_type')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">部门：</label>
				<div class="col-sm-8">
					<input id="dept" name="dept" th:field="*{dept}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">职位：</label>
				<div class="col-sm-8">
					<input id="position" name="position" th:field="*{position}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">生日：</label>
				<div class="col-sm-8">
					<input id="birthday" name="birthday" th:field="*{birthday}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">手机号：</label>
				<div class="col-sm-8">
					<input id="mobile" name="mobile" th:field="*{mobile}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">座机：</label>
				<div class="col-sm-8">
					<input id="tel" name="tel" th:field="*{tel}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">邮箱：</label>
				<div class="col-sm-8">
					<input id="email" name="email" th:field="*{email}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">微信号：</label>
				<div class="col-sm-8">
					<input id="wechat" name="wechat" th:field="*{wechat}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">QQ号：</label>
				<div class="col-sm-8">
					<input id="qq" name="qq" th:field="*{qq}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">传真：</label>
				<div class="col-sm-8">
					<input id="fax" name="fax" th:field="*{fax}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系地址：</label>
				<div class="col-sm-8">
					<input id="addr" name="addr" th:field="*{addr}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">补充说明：</label>
				<div class="col-sm-8">
					<textarea name="remark" autocomplete="off" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "crm/contact";
		$("#form-contact-edit").validate({
			rules:{
				name:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-contact-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
